<?php

class Welcome extends Controller {

	function Welcome()
	{
            parent::Controller();
	}

        function checkLogin()
        {
            if (!$this->ion_auth->logged_in())
            {
                redirect('auth/login');
            }
        }

	function index($id=0)
	{
            $this->load->library('users/ion_auth');
            $this->load->helper(array('url', 'html'));

            $this->checkLogin();

            $user = $this->ion_auth->get_user();

            $html = 'Hello ' . $user->first_name;
            $html .= '<br/>';

            $html .= anchor('auth/logout', 'logout');
            $html .= '<br/>';

            $data['html'] = $html;

            $this->load->view('welcome_message', $data);
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */